﻿using MusicPlayerPlus.Interface.Model.Enum;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows.Media;

namespace MusicPlayerPlus.PlugIn.MainWindows.ModelView
{
    public class MusicItemVM : ModelViewBase
    {
        public MusicItemVM(MusicPlayerPlus.Interface.Model.Muisc.MusicItem music)
        {
            this.ID = music.ID;
            this.Name = music.Name;
            this.AlbumName = music.AlbumName;
            this.Lyric = music.Lyric;
            this.Cove = music.Cove;
            this.CoveHD = music.CoveHD;
            this.CoveThumbnail = music.CoveThumbnail;
            this.Url = music.Url;
        }
        #region Base

        /// <summary>
        /// 唯一标识
        /// </summary>
        public Guid ID
        {
            get
            {
                return _id;
            }
            set
            {
                _id = value;
                this.NotifyPropertyChanged("ID");
            }
        }
        private Guid _id;

        /// <summary>
        /// 名称
        /// </summary>
        public string Name
        {
            get
            {
                return _name;
            }
            set
            {
                _name = value;
                this.NotifyPropertyChanged("Name");
            }
        }
        private string _name;
        /// <summary>
        /// 专辑名
        /// </summary>
        public string AlbumName
        {
            get
            {
                return _albumname;
            }
            set
            {
                _albumname = value;
                this.NotifyPropertyChanged("AlbumName");
            }
        }
        private string _albumname;
        /// <summary>
        /// 歌词
        /// </summary>
        public string Lyric
        {
            get
            {
                return _lyric;
            }
            set
            {
                _lyric = value;
                this.NotifyPropertyChanged("Lyric");
            }
        }
        private string _lyric;
        /// <summary>
        /// 封面
        /// </summary>
        public string Cove
        {
            get
            {
                return _cove;
            }
            set
            {
                _cove = value;
                this.NotifyPropertyChanged("Cove");
            }
        }
        private string _cove;

        /// <summary>
        /// 高清封面
        /// </summary>
        public string CoveHD
        {
            get
            {
                return _coveHD;
            }
            set
            {
                _coveHD = value;
                this.NotifyPropertyChanged("CoveHD");
            }
        }
        private string _coveHD;
        /// <summary>
        /// 封面缩略图
        /// </summary>
        public string CoveThumbnail
        {
            get
            {
                return _coveThumbnail;
            }
            set
            {
                _coveThumbnail = value;
                this.NotifyPropertyChanged("CoveThumbnail");
            }
        }
        private string _coveThumbnail;

        /// <summary>
        /// 解密后的 下载地址
        /// </summary>
        public string Url
        {
            get
            {
                return _url;
            }
            set
            {
                _url = value;
                this.NotifyPropertyChanged("Url");
            }
        }
        private string _url;

        #endregion

        /// <summary>
        /// 是否播放
        /// </summary>
        public bool Play
        {
            get
            {
                return _play;
            }
            set
            {
                _play = value;
                this.NotifyPropertyChanged("Play");
                this.NotifyPropertyChanged("BackGroundBrush");
            }
        }
        private bool _play = false;

        /// <summary>
        /// 是否播放
        /// </summary>
        public Brush BackGroundBrush
        {
            get
            {
                Brush br = null;
                if (Play)
                {
                    br = new SolidColorBrush(Color.FromArgb(255, 126, 255, 255));
                }
                return br;
            }
        }
    }
}
